<?php
    $auth               = $this->auth;
    $acl                = new My_Acl();
    $listAllow          = $acl->listAllowed($auth);
    
    $listMenu           = array();
    foreach($listAllow as $row){
        if($row['moduleName'] == 'admin' && $row['actionName'] == 'index' && !in_array($row['controllerName'], $listMenu)){
            $listMenu[]     = $row['controllerName'];
        }
    }
    
    $menuModule         = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
    $menuController     = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
    $menuAction         = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
    
?>
<ul class="menu">
    <li><span class="yellow">Xin chào <strong class="yellow"><?php echo $auth['username'];?></strong></span></li>
    <li><a href="/index/index">Trang chủ CI</a></li>
    <li><a href="/changepass/index">Đổi mật khẩu</a></li>
    <?php
        foreach($listMenu as $menu){
            if($menu == "game"){
                echo '<li><a href="/admin/game">Game</a></li>';
            }
            if($menu == "role"){
                echo '<li><a href="/admin/role">Phân quyền</a></li>';
            }
            if($menu == "user"){
                echo '<li><a href="/admin/user">Thành viên</a></li>';
            }
            if($menu == "categories"){
                echo '<li><a href="/admin/categories">Danh mục game</a></li>';
            }
            if($menu == "history"){
                echo '<li><a href="/admin/history">Lịch sử</a></li>';
            }
        }
    ?>
    <li><a href="/auth/logout" class="logout">Đăng xuất</a></li>
</ul>